package com.booter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * hessian rpc
 * <p>
 * Deprecated as of spring 5.3 (phasing out serialization-based remoting)
 * deprecate the class, and it will be removed in Spring 6.
 */

@Deprecated
@Slf4j
@SpringBootApplication()
public class HessianApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(HessianApplication.class, args);

        Runtime.getRuntime().addShutdownHook(new Thread(() -> log.info("application is shutting down")));
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(HessianApplication.class);
    }

}
